package cn.xuguowen.user.designPatten.factory.hsp_factory_method;

import cn.xuguowen.user.designPatten.factory.pizza.Pizza;

/**
 * ClassName: BJOrderPizza
 * Package: cn.xuguowen.user.designPatten.factory.method
 * Description:
 * 北京工厂订购披萨
 * @Author 徐国文
 * @Create 2023/4/25 17:40
 * @Version 1.0
 */
public class BJOrderPizza extends OrderPizza{
    @Override
    public Pizza getPizza(String orderType) {
        Pizza pizza = null;
        if ("cheese".equals(orderType)) {
            pizza = new BJCheesePizza();
            pizza.setName("北京奶酪");
        } else if ("greek".equals(orderType)) {
            pizza = new BJGreekPizza();
            pizza.setName("北京希腊");
        }
        return pizza;
    }
}
